modifier_item_suit_hanyu = class({})

local public = modifier_item_suit_hanyu

--------------------------------------------------------------------------------

function public:IsDebuff()
	return false
end

--------------------------------------------------------------------------------

function public:IsHidden()
	return false
end

--------------------------------------------------------------------------------

function public:IsPurgable()
	return false
end

--------------------------------------------------------------------------------

function public:GetTexture()
	return 'item_0614'
end

--------------------------------------------------------------------------------

function public:DeclareFunctions()
	local funcs = {
		MODIFIER_EVENT_ON_ATTACK_LANDED,
	}
	return funcs
end

--------------------------------------------------------------------------------

function public:OnAttackLanded(keys)
	if IsServer() then
		if RollPercentage(10) then
			local target = keys.target
			if target:IsAlive() and target ~= self:GetCaster() and keys.attacker == self:GetCaster() then
				target:AddNewModifier(target, nil, "modifier_item_suit_liudao_effect", {duration=1})
				ApplyDamage({
					attacker = keys.attacker,
					victim = keys.target,
					damage = keys.damage*4,
					damage_type = DAMAGE_TYPE_PHYSICAL,
				})
			end
		end
	end
end

--------------------------------------------------------------------------------